#include <hxcpp.h>

#ifndef INCLUDED_Std
#include <Std.h>
#endif
#ifndef INCLUDED_haxe_Log
#include <haxe/Log.h>
#endif
#ifndef INCLUDED_haxe_Public
#include <haxe/Public.h>
#endif
#ifndef INCLUDED_jax_JClassField
#include <jax/JClassField.h>
#endif
#ifndef INCLUDED_jax_JConstant
#include <jax/JConstant.h>
#endif
#ifndef INCLUDED_jax_JMethod
#include <jax/JMethod.h>
#endif
#ifndef INCLUDED_jax_JVM
#include <jax/JVM.h>
#endif
#ifndef INCLUDED_jax_JValue
#include <jax/JValue.h>
#endif
#ifndef INCLUDED_jax_lang_JClass
#include <jax/lang/JClass.h>
#endif
#ifndef INCLUDED_jax_lang_JObject
#include <jax/lang/JObject.h>
#endif
namespace jax{
namespace lang{

Void JClass_obj::__construct()
{
{
	HX_SOURCE_POS("Source/jax/lang/JClass.hx",16)
	super::__construct();
	HX_SOURCE_POS("Source/jax/lang/JClass.hx",17)
	this->_type = HX_CSTRING("java/lang/Class");
}
;
	return null();
}

JClass_obj::~JClass_obj() { }

Dynamic JClass_obj::__CreateEmpty() { return  new JClass_obj; }
hx::ObjectPtr< JClass_obj > JClass_obj::__new()
{  hx::ObjectPtr< JClass_obj > result = new JClass_obj();
	result->__construct();
	return result;}

Dynamic JClass_obj::__Create(hx::DynamicArray inArgs)
{  hx::ObjectPtr< JClass_obj > result = new JClass_obj();
	result->__construct();
	return result;}

Array< ::String > JClass_obj::getInterfaces( ){
	HX_SOURCE_PUSH("JClass_obj::getInterfaces")
	HX_SOURCE_POS("Source/jax/lang/JClass.hx",20)
	Array< ::String > r = Array_obj< ::String >::__new();
	HX_SOURCE_POS("Source/jax/lang/JClass.hx",21)
	{
		HX_SOURCE_POS("Source/jax/lang/JClass.hx",21)
		int _g = (int)0;
		Array< int > _g1 = this->interfaces;
		HX_SOURCE_POS("Source/jax/lang/JClass.hx",21)
		while(((_g < _g1->length))){
			HX_SOURCE_POS("Source/jax/lang/JClass.hx",21)
			int i = _g1->__get(_g);
			HX_SOURCE_POS("Source/jax/lang/JClass.hx",21)
			++(_g);
			HX_SOURCE_POS("Source/jax/lang/JClass.hx",22)
			r->push(::Std_obj::string(this->const_pool->__get(i)));
		}
	}
	HX_SOURCE_POS("Source/jax/lang/JClass.hx",24)
	return r;
}


HX_DEFINE_DYNAMIC_FUNC0(JClass_obj,getInterfaces,return )

::String JClass_obj::getName( ){
	HX_SOURCE_PUSH("JClass_obj::getName")
	struct _Function_1_1{
		inline static ::String Block( ::jax::lang::JClass_obj *__this){
			{
				struct _Function_2_1{
					inline static int Block( ::jax::lang::JClass_obj *__this){
						{
							HX_SOURCE_POS("Source/jax/lang/JClass.hx",27)
							{
::jax::JConstant _switch_1 = (__this->const_pool->__get(__this->this_id));
								switch((_switch_1)->GetIndex()){
									case 5: {
										int i = _switch_1->__Param(0);
{
											HX_SOURCE_POS("Source/jax/lang/JClass.hx",27)
											return i;
										}
									}
									;break;
									case 6: {
										int i = _switch_1->__Param(0);
{
											HX_SOURCE_POS("Source/jax/lang/JClass.hx",27)
											return i;
										}
									}
									;break;
									default: {
										HX_SOURCE_POS("Source/jax/lang/JClass.hx",27)
										return (int)0;
									}
								}
							}
						}
						return null();
					}
				};
				HX_SOURCE_POS("Source/jax/lang/JClass.hx",27)
				{
::jax::JConstant _switch_2 = (__this->const_pool->__get(_Function_2_1::Block(__this)));
					switch((_switch_2)->GetIndex()){
						case 0: {
							::String s = _switch_2->__Param(0);
{
								HX_SOURCE_POS("Source/jax/lang/JClass.hx",27)
								return s;
							}
						}
						;break;
						default: {
							HX_SOURCE_POS("Source/jax/lang/JClass.hx",27)
							return hx::Throw (HX_CSTRING("Not a string"));
						}
					}
				}
			}
			return null();
		}
	};
	HX_SOURCE_POS("Source/jax/lang/JClass.hx",26)
	return _Function_1_1::Block(this);
}


HX_DEFINE_DYNAMIC_FUNC0(JClass_obj,getName,return )

::String JClass_obj::getSuper( ){
	HX_SOURCE_PUSH("JClass_obj::getSuper")
	struct _Function_1_1{
		inline static ::String Block( ::jax::lang::JClass_obj *__this){
			{
				struct _Function_2_1{
					inline static int Block( ::jax::lang::JClass_obj *__this){
						{
							HX_SOURCE_POS("Source/jax/lang/JClass.hx",30)
							{
::jax::JConstant _switch_3 = (__this->const_pool->__get(__this->super_id));
								switch((_switch_3)->GetIndex()){
									case 5: {
										int i = _switch_3->__Param(0);
{
											HX_SOURCE_POS("Source/jax/lang/JClass.hx",30)
											return i;
										}
									}
									;break;
									case 6: {
										int i = _switch_3->__Param(0);
{
											HX_SOURCE_POS("Source/jax/lang/JClass.hx",30)
											return i;
										}
									}
									;break;
									default: {
										HX_SOURCE_POS("Source/jax/lang/JClass.hx",30)
										return (int)0;
									}
								}
							}
						}
						return null();
					}
				};
				HX_SOURCE_POS("Source/jax/lang/JClass.hx",30)
				{
::jax::JConstant _switch_4 = (__this->const_pool->__get(_Function_2_1::Block(__this)));
					switch((_switch_4)->GetIndex()){
						case 0: {
							::String s = _switch_4->__Param(0);
{
								HX_SOURCE_POS("Source/jax/lang/JClass.hx",30)
								return s;
							}
						}
						;break;
						default: {
							HX_SOURCE_POS("Source/jax/lang/JClass.hx",30)
							return hx::Throw (HX_CSTRING("Not a string"));
						}
					}
				}
			}
			return null();
		}
	};
	HX_SOURCE_POS("Source/jax/lang/JClass.hx",29)
	return _Function_1_1::Block(this);
}


HX_DEFINE_DYNAMIC_FUNC0(JClass_obj,getSuper,return )

::jax::JMethod JClass_obj::getMethod( ::jax::JConstant nt,Array< ::jax::JConstant > pool){
	HX_SOURCE_PUSH("JClass_obj::getMethod")
	HX_SOURCE_POS("Source/jax/lang/JClass.hx",32)
	{
::jax::JConstant _switch_5 = (nt);
		switch((_switch_5)->GetIndex()){
			case 7: {
				int t = _switch_5->__Param(1);
				int n = _switch_5->__Param(0);
{
					HX_SOURCE_POS("Source/jax/lang/JClass.hx",35)
					{
						HX_SOURCE_POS("Source/jax/lang/JClass.hx",35)
						int _g = (int)0;
						Array< ::jax::JMethod > _g1 = this->methods;
						HX_SOURCE_POS("Source/jax/lang/JClass.hx",35)
						while(((_g < _g1->length))){
							HX_SOURCE_POS("Source/jax/lang/JClass.hx",35)
							::jax::JMethod me = _g1->__get(_g);
							HX_SOURCE_POS("Source/jax/lang/JClass.hx",35)
							++(_g);
							HX_SOURCE_POS("Source/jax/lang/JClass.hx",36)
							if (((::jax::JVM_obj::toNativeValue(::jax::JVM_obj::toValue(pool->__get(n),null())) == ::jax::JVM_obj::toNativeValue(::jax::JVM_obj::toValue(pool->__get(me->name_index),null()))))){
								HX_SOURCE_POS("Source/jax/lang/JClass.hx",36)
								return me;
							}
						}
					}
					HX_SOURCE_POS("Source/jax/lang/JClass.hx",41)
					return null();
				}
			}
			;break;
			default: {
				HX_SOURCE_POS("Source/jax/lang/JClass.hx",42)
				return null();
			}
		}
	}
	HX_SOURCE_POS("Source/jax/lang/JClass.hx",32)
	return null();
}


HX_DEFINE_DYNAMIC_FUNC2(JClass_obj,getMethod,return )

::String JClass_obj::toString( ){
	HX_SOURCE_PUSH("JClass_obj::toString")
	HX_SOURCE_POS("Source/jax/lang/JClass.hx",45)
	return (HX_CSTRING("Java Class: ") + this->getName());
}


Void JClass_obj::initc( ){
{
		HX_SOURCE_PUSH("JClass_obj::initc")
		HX_SOURCE_POS("Source/jax/lang/JClass.hx",50)
		::haxe::Log_obj::trace((HX_CSTRING("Initiating ") + this->toString()),hx::SourceInfo(HX_CSTRING("JClass.hx"),50,HX_CSTRING("jax.lang.JClass"),HX_CSTRING("initc")));
		HX_SOURCE_POS("Source/jax/lang/JClass.hx",51)
		{
			HX_SOURCE_POS("Source/jax/lang/JClass.hx",51)
			int _g = (int)0;
			Array< ::jax::JClassField > _g1 = this->cfields;
			HX_SOURCE_POS("Source/jax/lang/JClass.hx",51)
			while(((_g < _g1->length))){
				HX_SOURCE_POS("Source/jax/lang/JClass.hx",51)
				::jax::JClassField f = _g1->__get(_g);
				HX_SOURCE_POS("Source/jax/lang/JClass.hx",51)
				++(_g);
				HX_SOURCE_POS("Source/jax/lang/JClass.hx",52)
				{
::jax::JConstant _switch_6 = (this->const_pool->__get(f->descriptor_index));
					switch((_switch_6)->GetIndex()){
						case 7: {
							int t = _switch_6->__Param(1);
							int n = _switch_6->__Param(0);
{
								HX_SOURCE_POS("Source/jax/lang/JClass.hx",53)
								::haxe::Log_obj::trace((((HX_CSTRING("FIELD:") + ::Std_obj::string(this->const_pool->__get(n))) + HX_CSTRING(": ")) + ::Std_obj::string(this->const_pool->__get(t))),hx::SourceInfo(HX_CSTRING("JClass.hx"),54,HX_CSTRING("jax.lang.JClass"),HX_CSTRING("initc")));
							}
						}
						;break;
						default: {
							HX_SOURCE_POS("Source/jax/lang/JClass.hx",55)
							::haxe::Log_obj::trace((HX_CSTRING("FIELD: ") + ::Std_obj::string(this->const_pool->__get(f->descriptor_index))),hx::SourceInfo(HX_CSTRING("JClass.hx"),56,HX_CSTRING("jax.lang.JClass"),HX_CSTRING("initc")));
						}
					}
				}
			}
		}
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(JClass_obj,initc,(void))


JClass_obj::JClass_obj()
{
}

void JClass_obj::__Mark(HX_MARK_PARAMS)
{
	HX_MARK_BEGIN_CLASS(JClass);
	HX_MARK_MEMBER_NAME(minor_version,"minor_version");
	HX_MARK_MEMBER_NAME(major_version,"major_version");
	HX_MARK_MEMBER_NAME(const_pool_count,"const_pool_count");
	HX_MARK_MEMBER_NAME(const_pool,"const_pool");
	HX_MARK_MEMBER_NAME(access_flags,"access_flags");
	HX_MARK_MEMBER_NAME(bitmask,"bitmask");
	HX_MARK_MEMBER_NAME(this_id,"this_id");
	HX_MARK_MEMBER_NAME(super_id,"super_id");
	HX_MARK_MEMBER_NAME(interf_count,"interf_count");
	HX_MARK_MEMBER_NAME(interfaces,"interfaces");
	HX_MARK_MEMBER_NAME(cfields,"cfields");
	HX_MARK_MEMBER_NAME(methods,"methods");
	super::__Mark(HX_MARK_ARG);
	HX_MARK_END_CLASS();
}

void JClass_obj::__Visit(HX_VISIT_PARAMS)
{
	HX_VISIT_MEMBER_NAME(minor_version,"minor_version");
	HX_VISIT_MEMBER_NAME(major_version,"major_version");
	HX_VISIT_MEMBER_NAME(const_pool_count,"const_pool_count");
	HX_VISIT_MEMBER_NAME(const_pool,"const_pool");
	HX_VISIT_MEMBER_NAME(access_flags,"access_flags");
	HX_VISIT_MEMBER_NAME(bitmask,"bitmask");
	HX_VISIT_MEMBER_NAME(this_id,"this_id");
	HX_VISIT_MEMBER_NAME(super_id,"super_id");
	HX_VISIT_MEMBER_NAME(interf_count,"interf_count");
	HX_VISIT_MEMBER_NAME(interfaces,"interfaces");
	HX_VISIT_MEMBER_NAME(cfields,"cfields");
	HX_VISIT_MEMBER_NAME(methods,"methods");
	super::__Visit(HX_VISIT_ARG);
}

Dynamic JClass_obj::__Field(const ::String &inName,bool inCallProp)
{
	switch(inName.length) {
	case 5:
		if (HX_FIELD_EQ(inName,"initc") ) { return initc_dyn(); }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"bitmask") ) { return bitmask; }
		if (HX_FIELD_EQ(inName,"this_id") ) { return this_id; }
		if (HX_FIELD_EQ(inName,"cfields") ) { return cfields; }
		if (HX_FIELD_EQ(inName,"methods") ) { return methods; }
		if (HX_FIELD_EQ(inName,"getName") ) { return getName_dyn(); }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"super_id") ) { return super_id; }
		if (HX_FIELD_EQ(inName,"getSuper") ) { return getSuper_dyn(); }
		if (HX_FIELD_EQ(inName,"toString") ) { return toString_dyn(); }
		break;
	case 9:
		if (HX_FIELD_EQ(inName,"getMethod") ) { return getMethod_dyn(); }
		break;
	case 10:
		if (HX_FIELD_EQ(inName,"const_pool") ) { return const_pool; }
		if (HX_FIELD_EQ(inName,"interfaces") ) { return interfaces; }
		break;
	case 12:
		if (HX_FIELD_EQ(inName,"access_flags") ) { return access_flags; }
		if (HX_FIELD_EQ(inName,"interf_count") ) { return interf_count; }
		break;
	case 13:
		if (HX_FIELD_EQ(inName,"minor_version") ) { return minor_version; }
		if (HX_FIELD_EQ(inName,"major_version") ) { return major_version; }
		if (HX_FIELD_EQ(inName,"getInterfaces") ) { return getInterfaces_dyn(); }
		break;
	case 16:
		if (HX_FIELD_EQ(inName,"const_pool_count") ) { return const_pool_count; }
	}
	return super::__Field(inName,inCallProp);
}

Dynamic JClass_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp)
{
	switch(inName.length) {
	case 7:
		if (HX_FIELD_EQ(inName,"bitmask") ) { bitmask=inValue.Cast< int >(); return inValue; }
		if (HX_FIELD_EQ(inName,"this_id") ) { this_id=inValue.Cast< int >(); return inValue; }
		if (HX_FIELD_EQ(inName,"cfields") ) { cfields=inValue.Cast< Array< ::jax::JClassField > >(); return inValue; }
		if (HX_FIELD_EQ(inName,"methods") ) { methods=inValue.Cast< Array< ::jax::JMethod > >(); return inValue; }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"super_id") ) { super_id=inValue.Cast< int >(); return inValue; }
		break;
	case 10:
		if (HX_FIELD_EQ(inName,"const_pool") ) { const_pool=inValue.Cast< Array< ::jax::JConstant > >(); return inValue; }
		if (HX_FIELD_EQ(inName,"interfaces") ) { interfaces=inValue.Cast< Array< int > >(); return inValue; }
		break;
	case 12:
		if (HX_FIELD_EQ(inName,"access_flags") ) { access_flags=inValue.Cast< int >(); return inValue; }
		if (HX_FIELD_EQ(inName,"interf_count") ) { interf_count=inValue.Cast< int >(); return inValue; }
		break;
	case 13:
		if (HX_FIELD_EQ(inName,"minor_version") ) { minor_version=inValue.Cast< int >(); return inValue; }
		if (HX_FIELD_EQ(inName,"major_version") ) { major_version=inValue.Cast< int >(); return inValue; }
		break;
	case 16:
		if (HX_FIELD_EQ(inName,"const_pool_count") ) { const_pool_count=inValue.Cast< int >(); return inValue; }
	}
	return super::__SetField(inName,inValue,inCallProp);
}

void JClass_obj::__GetFields(Array< ::String> &outFields)
{
	outFields->push(HX_CSTRING("minor_version"));
	outFields->push(HX_CSTRING("major_version"));
	outFields->push(HX_CSTRING("const_pool_count"));
	outFields->push(HX_CSTRING("const_pool"));
	outFields->push(HX_CSTRING("access_flags"));
	outFields->push(HX_CSTRING("bitmask"));
	outFields->push(HX_CSTRING("this_id"));
	outFields->push(HX_CSTRING("super_id"));
	outFields->push(HX_CSTRING("interf_count"));
	outFields->push(HX_CSTRING("interfaces"));
	outFields->push(HX_CSTRING("cfields"));
	outFields->push(HX_CSTRING("methods"));
	super::__GetFields(outFields);
};

static ::String sStaticFields[] = {
	String(null()) };

static ::String sMemberFields[] = {
	HX_CSTRING("minor_version"),
	HX_CSTRING("major_version"),
	HX_CSTRING("const_pool_count"),
	HX_CSTRING("const_pool"),
	HX_CSTRING("access_flags"),
	HX_CSTRING("bitmask"),
	HX_CSTRING("this_id"),
	HX_CSTRING("super_id"),
	HX_CSTRING("interf_count"),
	HX_CSTRING("interfaces"),
	HX_CSTRING("cfields"),
	HX_CSTRING("methods"),
	HX_CSTRING("getInterfaces"),
	HX_CSTRING("getName"),
	HX_CSTRING("getSuper"),
	HX_CSTRING("getMethod"),
	HX_CSTRING("toString"),
	HX_CSTRING("initc"),
	String(null()) };

static void sMarkStatics(HX_MARK_PARAMS) {
};

static void sVisitStatics(HX_VISIT_PARAMS) {
	HX_VISIT_MEMBER_NAME(JClass_obj::__mClass,"__mClass");
};

Class JClass_obj::__mClass;

void JClass_obj::__register()
{
	Static(__mClass) = hx::RegisterClass(HX_CSTRING("jax.lang.JClass"), hx::TCanCast< JClass_obj> ,sStaticFields,sMemberFields,
	&__CreateEmpty, &__Create,
	&super::__SGetClass(), 0, sMarkStatics, sVisitStatics);
}

void JClass_obj::__boot()
{
}

} // end namespace jax
} // end namespace lang
